package com.java.example.network

import com.java.example.app.Constant
import retrofit2.Retrofit
import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.converter.scalars.ScalarsConverterFactory

/**
 * @author chenll
 * @date 2024/2/22
 */

object RetrofitUtil {
    val sRetrofit: Retrofit by lazy {
        val builder = Retrofit.Builder()
        builder.baseUrl(Constant.HOST)
        builder.client(OkHttpClientUtil.httpClient)
        builder.addConverterFactory(ScalarsConverterFactory.create());
        builder.addConverterFactory(GsonConverterFactory.create())
        builder.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
        builder.build()
    }
}
